package com.atguigu.yygh.hosp.controller.admin;

import com.atguigu.yygh.common.result.R;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:hx
 * @DateTime:2022/11/9 17:44
 * @Description:
 */
@RestController
@RequestMapping("/admin/dept")
public class AdminDepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/getDeptByHoscode/{hoscode}")
    public R getDeptByHoscode(@PathVariable String hoscode){
        List<DepartmentVo> departmentVoList = departmentService.getDeptByHoscode(hoscode);
        return R.ok().data("list",departmentVoList);
    }
}
